function sendAJAX(method, url) {
  return new Promise((resolve, reject) => {
    let xhr = new XMLHttpRequest();
    xhr.responseType = 'json'
    xhr.open(method, url);
    xhr.send();
    xhr.onreadystatechange = function () {
      if (xhr.readyState === 4) {
        if (xhr.status >= 200 && xhr.status < 300) {
          //成功
          resolve(xhr.response);
        } else {
          //失败
          reject(xhr.status);
        }
      }
    };
  });
}

sendAJAX('get', 'http://api.xiaohigh.com/duanzi')
.then(data => {
  console.log(data);
})



fs.readFile('./index.html', (err) => {})

let p = mineReadFile('./index.html')

p.then(v => {

})

p.then(v => {
  
})